import request from '@/utils/request'
import { base_url } from '@/api/config'

export function setStatus(data) {
  return request({
    url: base_url + '/device-status/status',
    method: 'post',
    data
  })
}

export function setTag(data) {
  return request({
    url: base_url + '/device-status/tag',
    method: 'post',
    data
  })
}

// 分页查寻设备
export function findPage(data) {
  for (const key of ['tag', 'number']) {
    if (data[key] === '') delete data[key]
  }
  return request({
    url: base_url + '/device-status/page',
    method: 'post',
    data
  })
}

export function queryQuotaData(data) {
  for (const key of ['tag', 'number']) {
    if (data[key] === '') delete data[key]
  }
  return request({
    url: base_url + '/device-status/quota-data',
    method: 'post',
    data
  })
}

export function updateDeviceQuota(data) {
  return request({
    url: base_url + '/device-status/update-devicequota',
    method: 'post',
    data
  })
}

